﻿using System;
namespace Producers.Liiklusregister.Xtee.Riik.Ee.Producer.Liiklusregister {
    
    
    [global::Xtee.Core.Attributes.XmlTypeAttribute(Name="pol_soiduk", Namespace="http://producers.liiklusregister.xtee.riik.ee/producer/liiklusregister", Target=typeof(PolSoiduk))]
    public class PolSoidukSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
        
        protected IPolSoiduk clazz;
        
        public PolSoidukSerializer(IPolSoiduk clazz) {
            this.clazz = clazz;
        }
        
        public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
            base.WriteXml(Writer);
            Writer.WriteStartElement("id");
            Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
            Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.Id))).ToString());
            Writer.WriteEndElement();
            Writer.WriteStartElement("eelnev_id");
            Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
            Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.EelnevId))).ToString());
            Writer.WriteEndElement();
            Writer.WriteStartElement("jargnev_id");
            Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
            Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.JargnevId))).ToString());
            Writer.WriteEndElement();
            Writer.WriteStartElement("reg_mrk");
            if (clazz.RegMrk!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.RegMrk))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : RegMrk");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("vinkood");
            if (clazz.Vinkood!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Vinkood))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Vinkood");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("mark");
            if (clazz.Mark!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Mark))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Mark");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("mudel");
            if (clazz.Mudel!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Mudel))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Mudel");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("aasta");
            Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
            Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.Aasta))).ToString());
            Writer.WriteEndElement();
            Writer.WriteStartElement("varvus");
            if (clazz.Varvus!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Varvus))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Varvus");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("regtun");
            if (clazz.Regtun!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Regtun))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Regtun");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("tyypkd");
            if (clazz.Tyypkd!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Tyypkd))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Tyypkd");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("eestis");
            Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "date");
            Writer.WriteString(new global::Xtee.Core.Schema.XsdDate(((System.DateTime)(clazz.Eestis))).ToString());
            Writer.WriteEndElement();
            Writer.WriteStartElement("registris");
            Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "date");
            Writer.WriteString(new global::Xtee.Core.Schema.XsdDate(((System.DateTime)(clazz.Registris))).ToString());
            Writer.WriteEndElement();
            Writer.WriteStartElement("kateg");
            if (clazz.Kateg!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Kateg))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Kateg");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("kerenm");
            if (clazz.Kerenm!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Kerenm))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Kerenm");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("pikkus");
            Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
            Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.Pikkus))).ToString());
            Writer.WriteEndElement();
            Writer.WriteStartElement("laius");
            Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
            Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.Laius))).ToString());
            Writer.WriteEndElement();
            Writer.WriteStartElement("korgus");
            Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
            Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.Korgus))).ToString());
            Writer.WriteEndElement();
            Writer.WriteStartElement("telgarv");
            Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
            Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.Telgarv))).ToString());
            Writer.WriteEndElement();
            Writer.WriteStartElement("telgjuht");
            Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
            Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.Telgjuht))).ToString());
            Writer.WriteEndElement();
            Writer.WriteStartElement("telgveo");
            Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
            Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.Telgveo))).ToString());
            Writer.WriteEndElement();
            Writer.WriteStartElement("mootmudel");
            if (clazz.Mootmudel!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Mootmudel))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Mootmudel");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("mootmht");
            Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
            Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.Mootmht))).ToString());
            Writer.WriteEndElement();
            Writer.WriteStartElement("mootvms");
            Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
            Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.Mootvms))).ToString());
            Writer.WriteEndElement();
            Writer.WriteStartElement("kaigkastyp");
            if (clazz.Kaigkastyp!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Kaigkastyp))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Kaigkastyp");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("olek");
            if (clazz.Olek!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Olek))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Olek");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("isikud");
            if (clazz.Isikud!=null) {
                global::Xtee.Core.SerializationMetadata metaIsikud = this.GetMetaData(clazz.Isikud);
                Writer.WriteTypeAttribute(metaIsikud.TypeQualifiedName.Namespace, metaIsikud.TypeQualifiedName.Name);
                metaIsikud.NewSerializer(clazz.Isikud).WriteXml(Writer);
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Isikud");
            }
            Writer.WriteEndElement();
        }
        
        public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
            base.ReadXml(Reader);
        START:
            if ((Reader.LocalName == "id")) {
                goto id;
            }
            else {
                if ((Reader.LocalName == "eelnev_id")) {
                    goto eelnev_id;
                }
                else {
                    if ((Reader.LocalName == "jargnev_id")) {
                        goto jargnev_id;
                    }
                    else {
                        if ((Reader.LocalName == "reg_mrk")) {
                            goto reg_mrk;
                        }
                        else {
                            if ((Reader.LocalName == "vinkood")) {
                                goto vinkood;
                            }
                            else {
                                if ((Reader.LocalName == "mark")) {
                                    goto mark;
                                }
                                else {
                                    if ((Reader.LocalName == "mudel")) {
                                        goto mudel;
                                    }
                                    else {
                                        if ((Reader.LocalName == "aasta")) {
                                            goto aasta;
                                        }
                                        else {
                                            if ((Reader.LocalName == "varvus")) {
                                                goto varvus;
                                            }
                                            else {
                                                if ((Reader.LocalName == "regtun")) {
                                                    goto regtun;
                                                }
                                                else {
                                                    if ((Reader.LocalName == "tyypkd")) {
                                                        goto tyypkd;
                                                    }
                                                    else {
                                                        if ((Reader.LocalName == "eestis")) {
                                                            goto eestis;
                                                        }
                                                        else {
                                                            if ((Reader.LocalName == "registris")) {
                                                                goto registris;
                                                            }
                                                            else {
                                                                if ((Reader.LocalName == "kateg")) {
                                                                    goto kateg;
                                                                }
                                                                else {
                                                                    if ((Reader.LocalName == "kerenm")) {
                                                                        goto kerenm;
                                                                    }
                                                                    else {
                                                                        if ((Reader.LocalName == "pikkus")) {
                                                                            goto pikkus;
                                                                        }
                                                                        else {
                                                                            if ((Reader.LocalName == "laius")) {
                                                                                goto laius;
                                                                            }
                                                                            else {
                                                                                if ((Reader.LocalName == "korgus")) {
                                                                                    goto korgus;
                                                                                }
                                                                                else {
                                                                                    if ((Reader.LocalName == "telgarv")) {
                                                                                        goto telgarv;
                                                                                    }
                                                                                    else {
                                                                                        if ((Reader.LocalName == "telgjuht")) {
                                                                                            goto telgjuht;
                                                                                        }
                                                                                        else {
                                                                                            if ((Reader.LocalName == "telgveo")) {
                                                                                                goto telgveo;
                                                                                            }
                                                                                            else {
                                                                                                if ((Reader.LocalName == "mootmudel")) {
                                                                                                    goto mootmudel;
                                                                                                }
                                                                                                else {
                                                                                                    if ((Reader.LocalName == "mootmht")) {
                                                                                                        goto mootmht;
                                                                                                    }
                                                                                                    else {
                                                                                                        if ((Reader.LocalName == "mootvms")) {
                                                                                                            goto mootvms;
                                                                                                        }
                                                                                                        else {
                                                                                                            if ((Reader.LocalName == "kaigkastyp")) {
                                                                                                                goto kaigkastyp;
                                                                                                            }
                                                                                                            else {
                                                                                                                if ((Reader.LocalName == "olek")) {
                                                                                                                    goto olek;
                                                                                                                }
                                                                                                                else {
                                                                                                                    if ((Reader.LocalName == "isikud")) {
                                                                                                                        goto isikud;
                                                                                                                    }
                                                                                                                    else {
                                                                                                                        return;
                                                                                                                    }
                                                                                                                }
                                                                                                            }
                                                                                                        }
                                                                                                    }
                                                                                                }
                                                                                            }
                                                                                        }
                                                                                    }
                                                                                }
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        id:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk>id");
            }
            clazz.Id = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("id")).Value;
            goto START;
        eelnev_id:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk>eelnev_id");
            }
            clazz.EelnevId = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("eelnev_id")).Value;
            goto START;
        jargnev_id:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk>jargnev_id");
            }
            clazz.JargnevId = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("jargnev_id")).Value;
            goto START;
        reg_mrk:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk>reg_mrk");
            }
            clazz.RegMrk = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("reg_mrk")).Value;
            goto START;
        vinkood:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk>vinkood");
            }
            clazz.Vinkood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("vinkood")).Value;
            goto START;
        mark:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk>mark");
            }
            clazz.Mark = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("mark")).Value;
            goto START;
        mudel:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk>mudel");
            }
            clazz.Mudel = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("mudel")).Value;
            goto START;
        aasta:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk>aasta");
            }
            clazz.Aasta = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("aasta")).Value;
            goto START;
        varvus:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk>varvus");
            }
            clazz.Varvus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("varvus")).Value;
            goto START;
        regtun:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk>regtun");
            }
            clazz.Regtun = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("regtun")).Value;
            goto START;
        tyypkd:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk>tyypkd");
            }
            clazz.Tyypkd = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("tyypkd")).Value;
            goto START;
        eestis:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk>eestis");
            }
            clazz.Eestis = new global::Xtee.Core.Schema.XsdDate(Reader.ReadElementString("eestis")).Value;
            goto START;
        registris:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk>registris");
            }
            clazz.Registris = new global::Xtee.Core.Schema.XsdDate(Reader.ReadElementString("registris")).Value;
            goto START;
        kateg:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk>kateg");
            }
            clazz.Kateg = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("kateg")).Value;
            goto START;
        kerenm:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk>kerenm");
            }
            clazz.Kerenm = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("kerenm")).Value;
            goto START;
        pikkus:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk>pikkus");
            }
            clazz.Pikkus = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("pikkus")).Value;
            goto START;
        laius:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk>laius");
            }
            clazz.Laius = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("laius")).Value;
            goto START;
        korgus:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk>korgus");
            }
            clazz.Korgus = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("korgus")).Value;
            goto START;
        telgarv:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk>telgarv");
            }
            clazz.Telgarv = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("telgarv")).Value;
            goto START;
        telgjuht:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk>telgjuht");
            }
            clazz.Telgjuht = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("telgjuht")).Value;
            goto START;
        telgveo:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk>telgveo");
            }
            clazz.Telgveo = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("telgveo")).Value;
            goto START;
        mootmudel:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk>mootmudel");
            }
            clazz.Mootmudel = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("mootmudel")).Value;
            goto START;
        mootmht:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk>mootmht");
            }
            clazz.Mootmht = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("mootmht")).Value;
            goto START;
        mootvms:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk>mootvms");
            }
            clazz.Mootvms = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("mootvms")).Value;
            goto START;
        kaigkastyp:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk>kaigkastyp");
            }
            clazz.Kaigkastyp = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("kaigkastyp")).Value;
            goto START;
        olek:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk>olek");
            }
            clazz.Olek = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("olek")).Value;
            goto START;
        isikud:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk>isikud");
            }
            global::Xtee.Core.SerializationMetadata metaIsikud = this.GetMetaData<PolSoiduk.IIsikudType>(Reader, ">>pol_soiduk>isikud", "http://producers.liiklusregister.xtee.riik.ee/producer/liiklusregister");
            clazz.Isikud = metaIsikud.NewEntity<PolSoiduk.IIsikudType>();
            if ((Reader.IsEmptyElement == false)) {
                Reader.ReadStartElement("isikud");
                metaIsikud.NewSerializer(clazz.Isikud).ReadXml(Reader);
                Reader.ReadEndElement();
            }
            else {
                Reader.Skip();
            }
            goto START;
        }
        
        [global::Xtee.Core.Attributes.XmlTypeAttribute(Name=">>pol_soiduk>isikud", Namespace="http://producers.liiklusregister.xtee.riik.ee/producer/liiklusregister", Target=typeof(PolSoiduk.IsikudType))]
        public class IsikudTypeSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
            
            protected PolSoiduk.IIsikudType clazz;
            
            public IsikudTypeSerializer(PolSoiduk.IIsikudType clazz) {
                this.clazz = clazz;
            }
            
            public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
                base.WriteXml(Writer);
                for (int x = 0; ((clazz.Isikud != null) 
                            && (x < clazz.Isikud.Count)); x = (x + 1)) {
                    if (clazz.Isikud[x]!=null) {
                        Writer.WriteStartElement("isikud");
                        global::Xtee.Core.SerializationMetadata metaIsikud = this.GetMetaData(clazz.Isikud[x]);
                        Writer.WriteTypeAttribute(metaIsikud.TypeQualifiedName.Namespace, metaIsikud.TypeQualifiedName.Name);
                        metaIsikud.NewSerializer(clazz.Isikud[x]).WriteXml(Writer);
                        Writer.WriteEndElement();
                    }
                }
            }
            
            public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
                base.ReadXml(Reader);
                if (Reader.LocalName=="isikud") {
                    clazz.Isikud = new System.Collections.Generic.List<global::Producers.Liiklusregister.Xtee.Riik.Ee.Producer.Liiklusregister.IPolSoidukIsik>();
                    for (; ((Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
                                && (Reader.LocalName == "isikud")); ) {
                        if (Reader.IsElementNil()) {
                            throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>pol_soiduk>isikud>isikud");
                        }
                        global::Xtee.Core.SerializationMetadata metaIsikud = this.GetMetaData<global::Producers.Liiklusregister.Xtee.Riik.Ee.Producer.Liiklusregister.IPolSoidukIsik>(Reader, "pol_soiduk_isik", "http://producers.liiklusregister.xtee.riik.ee/producer/liiklusregister");
                        global::Producers.Liiklusregister.Xtee.Riik.Ee.Producer.Liiklusregister.IPolSoidukIsik item = metaIsikud.NewEntity<global::Producers.Liiklusregister.Xtee.Riik.Ee.Producer.Liiklusregister.IPolSoidukIsik>();
                        clazz.Isikud.Add(item);
                        if ((Reader.IsEmptyElement == false)) {
                            Reader.ReadStartElement("isikud");
                            metaIsikud.NewSerializer(item).ReadXml(Reader);
                            Reader.ReadEndElement();
                        }
                        else {
                            Reader.Skip();
                        }
                    }
                }
            }
        }
    }
}
